﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.OMM.HealthMonitor.Entity.Common;
using Sinacor.OMM.HealthMonitor.Entity.Msmq;

namespace Sinacor.OMM.HealthMonitor.Entity.Dumper
{
    [Serializable()]
    public class DumperData : HealthEntityBase, IHealthDataReset
    {

        public DumperData()
            : base(HealthType.Dumper)
        {
            ProcessDataInfo = new ProcessData(this);
            _msmqDumper = new MsmqData(this);
            ErrorData = new ErrorData(this);
        }

        private MsmqData _msmqDumper;
        public MsmqData MsmqDumper
        {
            get { return _msmqDumper; }
            set 
            { 
                _msmqDumper = value;
                this.LastUpdate = DateTime.Now;
            }
        }

        //Arquivo de dump
        private string _dumpRootPath;
        public string DumpRootPath
        {
            get { return _dumpRootPath; }
            set 
            { 
                _dumpRootPath = value;
                this.LastUpdate = DateTime.Now;
            }
        }

        //Mensagens Gravadas por Segundo
        private int _savedMessagesPerSecond;
        public int SavedMessagesPerSecond
        {
            get { return _savedMessagesPerSecond; }
            set 
            { 
                _savedMessagesPerSecond = value;
                this.LastUpdate = DateTime.Now;
            }
        }

        ProcessData _processData;
        public ProcessData ProcessDataInfo
        {
            get { return _processData; }
            set 
            { 
                _processData = value;
                this.LastUpdate = DateTime.Now;
            }
        }
        private ErrorData _errorData;

        public ErrorData ErrorData
        {
            get { return _errorData; }
            set
            {
                _errorData = value;
                this.LastUpdate = DateTime.Now;
            }
        }


        public void Reset()
        {
            ErrorData.Reset();
            ProcessDataInfo.Reset();
        }
    }
}
